/* 
 * File:   Circle.h
 * Author: RedEyedKiller
 *
 * Created on 24 Μάρτιος 2010, 7:07 μμ
 */

#ifndef _CIRCLE_H
#define	_CIRCLE_H

#include "Shape.h"

namespace Math
{
//class predefinitions
class Rect;

class Circle : public Shape
{
public:

    // <editor-fold defaultstate="collapsed" desc="Constructors">

    Circle()
    {
    }

    ~Circle()
    {
    }
    Circle(const Vector2F& cent, float radious);
    Circle(float centerX, float centerY, float radious);
    Circle(const Circle& orig); // </editor-fold>

    virtual Shape* Clone();

    /* Methods which return the distance between this and other shapes*/
    virtual Vector2Templ<float> DistanceClosestPoint(const Shape& shape) const;
    virtual Vector2Templ<float> DistanceClosestPoint(const Vector2F& vect) const;
    /*return true if this intersects with the shape*/
    /*touch return false*/
    virtual bool Intersect(const Shape& shape) const;
    virtual bool Intersect(const Vector2I& vec) const;
    virtual bool Intersect(const Vector2F& vec) const;
    virtual bool Intersect(const Vector2D& vec) const;
    /*the extented Intersection method proxies*/
    /*for more info look @ Math.h */
    virtual IntersectionType Intersect(const Shape& shape, Vector2Templ<float>& axisInfo)  const;
    /*returns the area of the circle*/
    virtual float CalculateArea()const;

    // <editor-fold defaultstate="collapsed" desc="Inline Setys and Getys">

    virtual inline void SetCenter(const Vector2F& center)
    {
        this->center = center;
    }

    inline void SetCenter(const float x, const float y)
    {
        this->center.Set(x, y);
    }

    virtual Vector2F GetCenter() const
    {
        return center.ConvertTo<float>();
    }

    inline void SetRadious(const float radious)
    {
        this->radious = radious;
    }

    inline float GetRadious() const
    {
        return radious;
    } // </editor-fold>
protected:
    //protected methods used for double dispatching
    //look at Shape.h for more info
    virtual bool IntersectWith(const Circle& circle) const;
    virtual bool IntersectWith(const Rect& rect) const;
    virtual IntersectionType IntersectWith(const Circle& circle, Vector2Templ<float>& axisInfo) const;
    virtual IntersectionType IntersectWith(const Rect& rect, Vector2Templ<float>& axisInfo) const;
    virtual Vector2Templ<float> DistanceClosestPointFrom(const Rect& rect) const;
    virtual Vector2Templ<float> DistanceClosestPointFrom(const Circle& circle) const;
private:
    float radious; //the radious of the circle
    Math::Vector2F center; //the center of the circle
};

}; //namespace
#endif	/* _CIRCLE_H */
